﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAO;
using DTO;
using System.Data;

namespace BUS
{
    public class BaoCaoCongNo_BUS
    {

        private static BaoCaoCongNo_BUS m_instance = null;

        public static BaoCaoCongNo_BUS Instance
        {
            get
            {
                if (m_instance == null)
                    m_instance = new BaoCaoCongNo_BUS();
                return m_instance;
            }
        }

        /// <summary>
        ///   them bao cao cong no
        ///   
        /// </summary>
        /// 

        public bool ThemBaoCaoCongNo(BaoCaoCongNo_DTO _item)
        {
            return BaoCaoCongNo_DAO.Instance.ThemBaoCaoCongNo(_item.NgayBaoCao);
        }

        /// <summary>
        ///   lay ma bao cao cong no
        /// </summary>
        /// 

        public string LayMaBaoCaoCongNo()
        {
            DataTable dt = BaoCaoCongNo_DAO.Instance.LayMaBaoCaoCongNo();
            DataRowCollection list = dt.Rows;
            if (list.Count==0)
            {
                return null;
            }
            DataRow dr = list[0];
            return (string)dr["MaBaoCaoCongNo"];
        }
    }
}
